/**
 * Fit scrollbar is done when both scrollbar-control are visible, leaving a space in the corner to prevent intersection
 */
@import "selectors";

@mixin fitTop {
  top: var(--scrollbar-total-size);
  bottom: 0;
}
@mixin fitBottom {
  bottom: var(--scrollbar-total-size);
  top: 0;
}
@mixin fitLeft {
  left: var(--scrollbar-total-size);
  right: 0;
}
@mixin fitRight {
  right: var(--scrollbar-total-size);
  left: 0;
}

@mixin fitVerticalScrollbar {
  @include fitScrollbarY {
    @include fitBottom;
  }
  @include scrollbarXInverted {
    @include fitScrollbarY {
      @include fitTop;
    }
  }
}

@mixin fitHorizontalScrollbar {
  @include ltr {
    @include fitScrollbarX {
      @include fitRight;
    }
    @include scrollbarYInverted {
      @include fitScrollbarX {
        @include fitLeft;
      }
    }
  }
  @include rtl {
    @include fitScrollbarX {
      @include fitLeft;
    }
    @include scrollbarYInverted {
      @include fitScrollbarX {
        @include fitRight;
      }
    }
  }
}
